int event_manager_create()
{




}


int event_attach(event_manager *evm, int code, event_handler_fn func) 
{
    avl_insert(evm->event_tree, code, (void*) func);
}


int event_send(event_manager *evm, int code, void *data)
{
    /*
     * Compute sender evm hash;
     */
    
    event *ev = event_malloc(); 
    ev->code = code;
    ev->data = data;

    lock(evm->event_mutex);
    list_add(evm->event_queue, ev);
    signal(evm->event_sem);
    unlock(evm->event_mutex);
}


int event_recv(event_manager *evm)
{
    

}

